﻿#ifndef POSTWINDOWBASE_H
#define POSTWINDOWBASE_H

#include <QWidget>
//#include "BaseModule/GlobalEnums.h"
//#include "BaseModule/EMDADefine.h"
//#include "BaseWidget/QFDialog.h"

class QBaseWidget;
class vtkActor;

namespace pst
{
    //class PostWindowBase// : public QFDialog
    class PostWindowBase : public QWidget
    {
        Q_OBJECT
    public:
        PostWindowBase(QWidget* parent/*, int caseID*//*, BaseModule::GraphWindowType type = BaseModule::GraphWindowType::UnDefined*/);
        virtual ~PostWindowBase();


    signals:
        void windowClosed(int caseID, int resultWindowID);

    public:

        ////brief    :  获取类型
        ////return   :  窗口类型
        //BaseModule::GraphWindowType getGraphWindowType();

        //brief    :  获取算例ID
        //return   : 算例ID 
        //int getCaseID();

        /// @brief 获取英文字体路径
        /// @return 路径
        QString getEnglishFontPath();

        /// @brief 获取中文字体路径
        /// @return 路径
        QString getChineseFontPath();

        //brief    :  字符串形式获取窗口类型
        //return   :  BaseModule::GraphWindowType 字串
        //QString getStringGraphWindowType();

        //brief    :  保存图片
        //input    :  fileName，width，heigh，showDlg
        virtual void saveImage(QString fileName, int width, int heigh, bool showDlg, bool autoSize);

        //brief    :  设置视角
        //input    :  view
        virtual void setView(QString view);

        //brief    :  
        //input    :  
        virtual void setViewValue(int x1, int x2, int x3, int y1, int y2, int y3, int z1, int z2, int z3);

        //brief    :  设置背景颜色
        //input    :  color1，color2
        virtual void setBackGround(QColor color1, QColor color2);

        //brief    :  重新翻译
        virtual void reTranslate();
        //brief    :  设置窗体
        //virtual void setWindow() override;
        /// @brief 子类实现，处理交互器回调回来的消息
        /// @param id 
        /// @param act 
        virtual void HandleCurveMSG(QString id, vtkActor* act);
        virtual void HandlePointMSG(int id, double* pos);
        /// @brief 子类实现，显示标记过的点
        virtual void showMarkedPoints(bool show);
        virtual void setCatchBallSize(double r);
        virtual void setCatchBallPosition(double* r);

        /// @brief 左键拾取一个actor和其上的cellId
        /// @param actor 
        /// @param id 
        virtual void leftClickedActorAndPointId(vtkActor* actor, int id);

        /// @brief 右键拾取一个actor和其上的cellId
        /// @param actor 
        /// @param id 
        virtual void rightClickedActorAndPointId(vtkActor* actor, int id);

    protected:
        /// @brief 更新窗口
        //void updateWindowTitle();

    private:
        void connectSignals();
        virtual void fitView();
        virtual void setViewXPlus();
        virtual void setViewXMiuns();
        virtual void setViewYPlus();
        virtual void setViewYMiuns();
        virtual void setViewZPlus();
        virtual void setViewZMiuns();
        virtual void setViewTrimetric();


        //virtual void keyPressEvent(QKeyEvent* e) override;
        //virtual void keyReleaseEvent(QKeyEvent* e) override;

        void initFontFiles();

    protected:
        //int m_caseID{ -1 };//算例ID
        //BaseModule::GraphWindowType _graphWindowType{ BaseModule::GraphWindowType::UnDefined };

    private:
        /// @brief 中文字体路径
        QString m_ChineseFontPath;
        /// @brief 英文字体路径
        QString m_EnglishFontPath;
    };


}


#endif
